<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
    xmlns:h="http://java.sun.com/jsf/html"  
    xmlns:f="http://java.sun.com/jsf/core"  
    xmlns:p="http://primefaces.org/ui"
    xmlns:ui="http://java.sun.com/jsf/facelets">   
  
    <h:head> 
    	<f:facet name="first">
            <meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
            <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
            <title>Locadora - Graph</title>
        </f:facet>
 
        <link type="text/css" rel="stylesheet" href="#{request.contextPath}/admin/css/cadastroFilme.css" /> 
    	
    </h:head>  
      
    <h:body>
  	 	
    <p:layout style="min-width:400px;min-height:200px;" id="layout" fullpage="true">  
    	<p:layoutUnit position="north" size="100"  resizable="true" closable="true" collapsible="true">  
        	
    <h:form> 
        	
  			<p:outputLabel>Cadastro de Usuário</p:outputLabel> 
  </h:form>
    	</p:layoutUnit>  
    	   
    <p:layoutUnit position="center" style="overflow:hidden; height:400px;" size="400" collapsible="true" >   
     <p:panel header="Cadastro de usuario" style="width:50%;margin:0 auto;">
      <h:form style="overflow:hidden;">
       	 <p:messages />
	       <h:panelGrid columns="2" >
	       	  <p:outputLabel>Nome</p:outputLabel>
	          <p:inputText id="nomeUser"  value="#{userBean.userTo.name}" required="true" requiredMessage="Nome Obrigatorio">
	          	<f:validateLength minimum="3" />
	          </p:inputText>
	   		  <p:outputLabel>Email</p:outputLabel>
	          <p:inputText id="emailUser"  value="#{userBean.userTo.email}" required="true" requiredMessage="Email Obrigatorio">
	          	<f:validateLength minimum="3" />
	          </p:inputText>
			  <p:outputLabel>Senha</p:outputLabel>
	          <p:inputText id="passwordUser"  value="#{userBean.userTo.password}" required="true" type="secret" requiredMessage="Nome Obrigatorio">
	          	<f:validateLength minimum="3" />
	          </p:inputText>
	        </h:panelGrid>
	        <p:outputLabel></p:outputLabel> 
	        <p:commandButton actionListener="#{userBean.saveUser}" value="Cadastrar"  ajax="false"></p:commandButton>
	        
   		</h:form> 
   		</p:panel>
   		</p:layoutUnit>
   		
   		</p:layout>
    </h:body>  
</html>  